<?php
$con = mysql_connect('localhost','root','root') or die('请检查数据库连接'.mysql_error());
mysql_query("SET NAMES gb2312");
$db = mysql_select_db("get_content",$con);

if(!$db){
	die("数据库不存在".mysql_error());
}else {
	$sql = "SELECT * FROM `articles` LIMIT 0,10";
	$result = mysql_query($sql,$con);
	$num_rows = mysql_num_rows($result);
	
}

?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<title>采集内容列表页面</title>
</head>
<body>
<style>
span{display:inline-block;}
</style>
	<h1>采集内容列表页面</h1>
	<div style="width:100%">
		<ul>
			<li style="border-bottom:1px solid #ccc;margin-bottom:20px;padding-bottom:10px;">
				<span style="width:10%;">日期</span><span style="width:70%;">标题</span><span style="width:10%;">修改</span>
			</li>
			<?php
				for($i=0;$i<$num_rows;$i++){
					$rows = mysql_fetch_array($result);		
			?>
			<li style="border-bottom:1px dashed #ccc;padding-bottom:5px;margin-bottom:5px; ">
				<span style="width:10%;"><?php echo $rows['date'] ?></span><span style="width:70%;"><?php echo $rows['title'] ?></span><span style="width:10%;"><a href="articles_save.php?aid=<?php echo $rows['id'] ?>">修改</a></span>
			</li>
			<?php
				}
			?>
		</ul>
	</div>
</body>
</html>